<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {

    function _initViewHelpers() {
        //necessaire pour exploiter navigation.xml
        $this->bootstrap('layout');
        $layout = $this->getResource('Layout');
        $view = $layout->getView();
        $navContainerConfig = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav');
        $navContainer = new Zend_Navigation($navContainerConfig);
        $view->navigation($navContainer);
    }

    protected function _initAutoLoad() {
        $modelLoader = new Zend_Application_Module_Autoloader(array(
            'namespace' => '',
            'basePath' => APPLICATION_PATH
        ));

        $acl = new Model_LibraryAcl();
        $auth = Zend_Auth::getInstance();

        $fc = Zend_Controller_Front::getInstance();
        $fc->registerPlugin(new Plugin_AccesCheck($acl, $auth));

        return $modelLoader;
    }

}

